package model;
import java.awt.Component;
import javax.swing.DefaultListCellRenderer;
import javax.swing.JList;
import model.Artist;

public class ArtistListCellRenderer extends DefaultListCellRenderer {

    @Override
    public Component getListCellRendererComponent(
            JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
        super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
        if (value instanceof Artist) {
            Artist c = (Artist) value;
            //setText(c.getLastname());
            setText(c.getFirstname()+(c.getLastname()));
        }
        return this;
    }
}